package cn.tedu.api;

import java.math.BigDecimal;
import java.util.Scanner;

public class T4_BigDecimal {
    public static void main(String[] args) {
        method();//暴露问题
        method2();
    }
    public static void method2(){
        Double a = new Scanner(System.in).nextDouble();
        Double b = new Scanner(System.in).nextDouble();
        // BigDecimal(double d)
        //BigDecimal(String s)
        BigDecimal bd1 = new BigDecimal(String.valueOf(a));
        BigDecimal bd2 = new BigDecimal(b+"");
        BigDecimal x1 = bd1.add(bd2);
        System.out.println(x1);
        BigDecimal x2 = bd1.subtract(bd2);
        System.out.println(x2);
        BigDecimal x3 = bd1.multiply(bd2);
        System.out.println(x3);
        BigDecimal x4 = bd1.divide(bd2,5,BigDecimal.ROUND_HALF_UP);
        System.out.println(x4);



    }
    public static void method(){
        Double a = new Scanner(System.in).nextDouble();
        Double b = new Scanner(System.in).nextDouble();
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);
    }

}
